package com.example.zuoye.utils;

import com.example.zuoye.resultentity.ResultDT;

public class ResultDTUtils {
    public static final Integer COMMENT_ERROR = 403;    // 评论格式非法
    public static final Integer NULL_DATA = 401;    // 空数据
    public static final Integer SUBMIT_ERROR = 400; // 提交错误

    public static ResultDT success(Object object){
        System.out.println("执行object");
        ResultDT resultV0 = new ResultDT();
        resultV0.setCode(200);
        resultV0.setMsg("success");
        resultV0.setData(object);
        return resultV0;
    }

    public static ResultDT success(Object o1,Object o2){
        System.out.println("执行Object o1,Object o2");
        ResultDT resultV0 = new ResultDT();
        resultV0.setCode(200);
        resultV0.setMsg("success");
        resultV0.setData(o1);
        resultV0.setAddData(o2);
        System.out.println("o1="+o1);
        System.out.println("o2="+o2);
        System.out.println(resultV0);
        return resultV0;
    }

    public static ResultDT success(){return success(null);}

    public static ResultDT error(Integer code,String msg){
        ResultDT resultV0 = new ResultDT();
        resultV0.setCode(code);
        resultV0.setMsg(msg);
        return resultV0;
    }
}
